package cn.zeal4j.controller;

import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author Administrator
 * @file IntelliJ IDEA Spring-Security-SSO-Client
 * @create 2020 09 30 0:38
 */
@Controller
@RequestMapping("user")
public class UserController {

    /**
     * user/getCurrentUser
     * @param authentication
     * @return
     */
    @RequestMapping("getCurrentUser")
    @ResponseBody
    public Object getCurrentUser(Authentication authentication) {
        // return authentication.getPrincipal();
        return authentication;
    }
}
